package org.sam.beatles.pojo;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.hibernate.annotations.ColumnDefault;

/**
 * 实体对象
 * 
 * @author sam
 *
 */
@Entity(name = "SYS_PROJECT")
public class SysProject implements Serializable {

	/**
	 * id
	 */
	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	/**
	 * 项目名称
	 */
	@Column(name = "PROJECTNAME", nullable = false)
	private String name;

	/**
	 * 别名,英文名
	 */
	@Column(name = "PROJECTALIASNAME")
	private String aliasName;

	/**
	 * 创建时间
	 */
	@Column(name = "PROJECTCREATIONTIME")
	@ColumnDefault("'1970-01-01 00:00:00.000'")
	private LocalDateTime createTime;

	/**
	 * 仿真的开始时间
	 */
	@Column(name = "DAYDATE1")
	@ColumnDefault("'1970-01-01 00:00:00.000'")
	private Date date;

	/**
	 * 版本
	 */
	@Column(name = "VERSION")
	@ColumnDefault("'1.0.0'")
	private String version;
	/**
	 * 备注
	 */
	@Column(name = "COMMENT")
	private String comment;

	private static final long serialVersionUID = 2888724974894199527L;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAliasName() {
		return aliasName;
	}

	public void setAliasName(String aliasName) {
		this.aliasName = aliasName;
	}

	public LocalDateTime getCreateTime() {
		return createTime;
	}

	public void setCreateTime(LocalDateTime createTime) {
		this.createTime = createTime;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	@Override
	public int hashCode() {
		return Objects.hash(aliasName, comment, createTime, date, id, name, version);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SysProject other = (SysProject) obj;
		return Objects.equals(aliasName, other.aliasName) && Objects.equals(comment, other.comment)
				&& Objects.equals(createTime, other.createTime) && Objects.equals(date, other.date)
				&& Objects.equals(id, other.id) && Objects.equals(name, other.name)
				&& Objects.equals(version, other.version);
	}

	@Override
	public String toString() {
		return "SysProject [id=" + id + ", name=" + name + ", aliasName=" + aliasName + ", createTime=" + createTime
				+ ", date=" + date + ", version=" + version + ", comment=" + comment + "]";
	}

}
